/* 获取文件信息 */
function getFileInfo(filePath){
	 return new Promise((resolve,reject)=>{
		 uni.getFileInfo({
			 filePath,
			 digestAlgorithm:'sha1',
			 success: function(res){
				 res.digest = res.digest.toLowerCase()
				 resolve(res)
			 },
			 fail:function(e){
			 	reject(e)
			 }
		 })
	 })
}
/* 获取图片信息 */
function getImageInfo(filePath){
	 return new Promise((resolve,reject)=>{
		 uni.getImageInfo({
			 src:filePath,
			 success: function(res){
				 resolve(res)
			 },
			 fail:function(e){
			 	reject(e)
			 }
		 })
	 })
}

/* 获取视频信息 */
function getVideoInfo(filePath){
	 return new Promise((resolve,reject)=>{
		 uni.getVideoInfo({
			 src:filePath,
			 success: function(res){
				 resolve(res)
			 },
			 fail:function(e){
			 	reject(e)
			 }
		 })
	 })
}

/* 获取语音信息 */
function getAudioInfo(filePath){
	 return new Promise((resolve,reject)=>{
		 plus.io.getAudioInfo({
			 filePath:filePath,
			 success: function(res){
				 resolve(res)
			 },
			 fail:function(e){
			 	reject(e)
			 }
		 })
	 })
}


export default {
	getFileInfo,
	getImageInfo,
	getVideoInfo,
	getAudioInfo
}

